package com.rc.saas.tenant.service.ugs;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.ugs.TenantUgsMemberLevelMapper;
import com.rc.saas.tenant.search.tenant.TenantUgsMemberLevelSearch;
import com.rc.saas.tenant.vo.ugs.TenantUgsMemberLevelResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author frog
 * @date 2021/4/8
 */
@Service
public class TenantUgsMemberLevelServiceImpl implements TenantUgsMemberLevelService {

    @Autowired
    private TenantUgsMemberLevelMapper tenantUgsMemberLevelMapper;

    @Override
    public TenantUgsMemberLevelMapper getMapper() {
        return tenantUgsMemberLevelMapper;
    }

    @Override
    public PageInfo<TenantUgsMemberLevelResultVo> listPageTenantUgsMemberLevel(TenantUgsMemberLevelSearch tenantUgsMemberLevelSearch) {
        PageHelper.startPage(tenantUgsMemberLevelSearch.getOffset(), tenantUgsMemberLevelSearch.getLimit());
        List<TenantUgsMemberLevelResultVo> tenantUgsLevelTypelist = tenantUgsMemberLevelMapper.listPageTenantUgsMemberLevel(tenantUgsMemberLevelSearch);
        return new PageInfo<TenantUgsMemberLevelResultVo>(tenantUgsLevelTypelist);
    }
}
